package Obj.getClass;

import java.util.ArrayList;
import java.util.Iterator;

public class Demo01 {
    public static void main(String[] args) {
        student s1 = new student("qq",11);
        student s2 = new student("ww",22);
        student s3 = new student("ee",33);
        student s4 = new student("rr",44);
        ArrayList list = new ArrayList<>();
        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        System.out.println(list.toString());
        Iterator iterator=list.iterator();
        while (iterator.hasNext()){
            student s = (student) iterator.next();
            System.out.println(s.toString());
        }
    }
}
